]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Fix setting surrounding text
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 11 Sep 2018 13:36:35 +0000 (15:36 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 4 Oct 2018 16:33:12 +0000 (16:33 +0000)
The underlying ibus method expects an object of type IBusText rather
than a plain string.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/228

js/misc/inputMethod.js

index ec84f7277825979cde99542ff480ee10f4d38ead..7fb78178ae7453b2f58b7258a6620872926867ec 100644 (file)
@@ -176,8 +176,11 @@ var InputMethod = new Lang.Class({
     },
 
     vfunc_set_surrounding(text, cursor, anchor) {
-        if (this._context && text)
-            this._context.set_surrounding_text(text, cursor, anchor);
+        if (!this._context || !text)
+            return;
+
+        let ibusText = IBus.Text.new_from_string(text);
+        this._context.set_surrounding_text(ibusText, cursor, anchor);
     },
 
     vfunc_update_content_hints(hints) {